package map.android.baidu.carpool.data.impl;

import android.content.Context;
import map.android.baidu.carpool.WebConfig;
import map.android.baidu.carpool.data.CarpoolBaseData;
import map.android.baidu.carpool.response.OrderListResponse;
import map.android.baidu.carpool.setting.UserInfoSetting;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhangtongyu on 15/3/23.
 * main模块订单列表接口request
 */
public class OrderListData extends CarpoolBaseData<OrderListResponse>{

    private int pn; //页码
    private int rn = 10; //每页条数

    public OrderListData(Context context) {
        super(context);
    }

    public void setPn(int pn) {
        this.pn = pn;
    }

    public void setRn(int rn) {
        this.rn = rn;
    }

    @Override
    protected String getUrl() {
        return WebConfig.getUrl(WebConfig.URL_ID_ORDER_LIST);
    }

    @Override
    protected Map<String, String> getParams() {
        Map<String , String> params = new HashMap<String, String>();
        params.put("pn" , String.valueOf(pn));
        params.put("rn" , String.valueOf(rn));
        params.put("bduss", UserInfoSetting.getBduss());
        return params;
    }
}
